Many JAVA® technologies currently require the generation of classes based on some input class. A prime example is ENTERPRISE JAVA BEANS® (EJBs®), which require the generation of a particular application server's container classes to wrap the developer supplied bean class.
To date this process of code generation has largely been undertaken with invocations of methods that use printout statements to build the required files, generally one file at a time. In addition, most of these generation facilities attempt to create a complete file at once rather than taking a more modular approach to the assembly of the generated file. Although this process works for small projects, it quickly becomes unwieldy for larger projects, leading to increased expense. In addition, tracking down errors in code generation or making modifications to accommodate new requirements is a difficult, expensive, and time-consuming process since the correct method and the correct print statement needs to be found amongst many similar looking statements. A need arises for a technique by which code can be generated that reduces the cost for large projects and that provides easier and quicker ways of finding errors and making modifications.